package Fundation;


//进制转换
public class BaseConversion {
    public static void main(String[] args) {
        //十进制(decimal)转二进制(binary)
        int decimal=10;
        String binary=Integer.toBinaryString(decimal);
        System.out.println(binary);//1010

        //八进制(Octal)
        String octal=Integer.toOctalString(decimal);
        System.out.println(octal);//12

        //十六进制(Hexadecimal)
        String hexadecimal=Integer.toHexString(decimal);
        System.out.println(hexadecimal);//a
    }
}
